<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			// call继承 : 只能拿到父类的私有
			
			//父类
			function Parent(name,age){//私有
				this.name=name;
				this.age=age;
			}
			Parent.prototype.show=function(){//公有
				console.log("111");
			}
			let p=new Parent("lili",20);
			console.log(p);
			
			//子类
			function Child(job){//私有
				this.job=job
				//1. Parent普通方法执行 
				//2. 修改this-->c实例对象
				//3. 传递参数  "lisa","18"
				Parent.call(this,"lisa","18");
			}
			Child.prototype.myjob=function(){//公有
				console.log("222");
			}
			let c=new Child("程序员");
			console.log(c);
		</script>
		
		<!-- <script>
			function show(n,m){
				console.log(this,n,m);
			}
			show.call("aaa",10,20)
			//show普通方法执行  this--->"aaa" 传递参数10，20
		</script> -->
	</body>
</html>
